<template>
    <div class="agent-info">
        <div class="box">
            <view class="title">
                <div class='item'>
                    ئالىي ئەزا: <span class='em'>{{mukapat.vip}} يۈەن</span>
                </div>
                <div class='item'>
                    چېكىلىش : <span class='em'>{{mukapat.user}} يۈەن</span>
                </div>
            </view>
            <div class="url">
                <div class='item'>
                    <div class='label'>APPID:</div>
                    <div class='content'>{{appInfo.appid?appInfo.appid:'-'}}</div>
                    <div class="copy" @click="copy(appInfo.appid?appInfo.appid:'-')">كۆچۈرىمەن</div>
                </div>
                <div class='item'>
                    <div class='label'>小程序路径:</div>
                    <div class='content'>{{appInfo.pages?appInfo.pages:'-'}}</div>
                    <div class="copy" @click="copy(appInfo.pages?appInfo.pages:'-')">كۆچۈرىمەن</div>
                </div>
                <div class='item'>
                    <div class='label'>备用网页:</div>
                    <div class='content'>{{appInfo.url?appInfo.url:'-'}}</div>
                    <div class="copy" @click="copy(appInfo.url?appInfo.url:'-')">كۆچۈرىمەن</div>
                </div>
            </div>
            <view @click="kino_handleClick" class="kinoUrl">
                <view class="right">
                    <div class="icon">
                        <image class="img" mode="widthFix" src="/static/img/agent/kino.svg"></image>
                    </div>
                    <div class="text">فىلىم ئادرېسلىرى</div>
                </view>
                <div class="jin">
                    <image class="img" mode="widthFix" src="/static/img/icon/kirish.svg"></image>
                </div>
            </view>
        </div>
    </div>
</template>

<script>
    export default {
        props: {
            mukapat: {
                type: Object,
                require: true
            },
            appInfo: {
                type: Object,
                require: true
            }
        },
        methods: {
            copy(key) {
                uni.setClipboardData({
                    data: key,
                    success: function(t) {
                        uni.showToast({
                            title: "success",
                            icon: 'success'
                        });
                    }
                });
            },
            kino_handleClick() {
                uni.navigateTo({
                    url: "/pages/kino/index"
                });
            },
        },
    }
</script>

<style lang="scss" scoped>
    .agent-info {
        padding: 0 30px;
        background-color: #fff;
        overflow: hidden;

        .box {
            direction: rtl;
        }

        .title {
            overflow: hidden;
            border-radius: 20rpx;
            overflow: hidden;
            border-radius: 20rpx;
            height: 100rpx;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background-color: #f6f6f6;

            .item {
                display: block;
                width: 50%;
                border-left: 1rpx solid #ccc;
                text-align: center;
                color: #999;
                font-size: 26rpx;

                &:nth-last-child(1) {
                    border-left: 0;
                }

                .em {
                    color: #2e82ff;
                }
            }
        }

        .url {
            overflow: hidden;
            display: block;
            direction: ltr;
            padding-top: 30rpx;

            .item {
                overflow: hidden;
                height: 80rpx;
                line-height: 80rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                text-align: center;
                font-size: 24rpx;

                .label {
                    overflow: hidden;
                    display: block;
                    font-family: normal;
                    width: 25%;
                }

                .content {
                    overflow: hidden;
                    display: block;
                    font-family: normal;
                    width: 65%;
                    color: #999;
                    padding: 0 10rpx;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }

                .copy {
                    width: 30%;
                    overflow: hidden;
                    display: block;
                    background-image: linear-gradient(90deg, #0aece7 0%, #5885fb 100%);
                    color: #fff;
                    height: 60rpx;
                    line-height: 56rpx;
                    border-radius: 60rpx;
                }
            }
        }

        .kinoUrl {
            border-top: 1rpx solid #eee;
            justify-content: space-between;
            height: 90rpx;
            line-height: 90rpx;
            margin-top: 30rpx;
            overflow: hidden;
            display: flex;
            align-items: center;

            .jin {
                overflow: hidden;
                width: 26rpx;
                height: 26rpx;

                .img {
                    width: 26rpx;
                    height: 26rpx;
                    display: block;
                }
            }

            .right {
                overflow: hidden;
                display: flex;
                align-items: center;
                justify-content: start;
                font-size: 26rpx;

                .icon {
                    width: 60rpx;
                    height: 60rpx;
                    display: block;

                    .img {
                        display: block;
                        width: 44rpx;
                    }
                }
            }
        }

    }
</style>